import 'package:dio/dio.dart';
import './api_interceptors.dart';
import './api_urls.dart' as api_urls;

class ApiMethods {
  final ApiInterceptors _apiInterceptors = ApiInterceptors();

  Future<T?> getFolderList<T>({Function(T?)? onSuccess, Function(DioException?)? onError}) async {
    return _apiInterceptors.get<T>(api_urls.getFolderList, onSuccess: onSuccess, onError: onError);
  }

  Future<T?> getFileList<T>(String folderName, {Function(T?)? onSuccess, Function(DioException?)? onError}) async {
    return _apiInterceptors.get<T>("${api_urls.getFileList}/$folderName", onSuccess: onSuccess, onError: onError);
  }
}
